#include <stdio.h>

int main()
{
    char s[6];
    int a = scanf("%s", (char*)&s);

    printf("%d", ((s[0]-'0') + (s[1]-'0') + (s[2]-'0') ));
    
    return 0;
}